package com.example.guava.ratelimiter.controller;

import com.example.guava.ratelimiter.annotation.XlRateLimiter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试限流 -
 * @author zhouxuan
 * @date 2020/5/15 17:43
 */
@RestController
@Slf4j
public class GuavaController {

    @XlRateLimiter(key = "test1")
    @GetMapping("test1")
    public String test() throws InterruptedException {
        return "test1";
    }

    @GetMapping("test2")
    @XlRateLimiter(key = "test1")
    public String test2() {

        return "test2";
    }
}
